import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpClient.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpNoTokenClient.dart';

class ForgetPwdHttpRequest {
  /// 获取验证码
  static Stream getCode(String phone) {
    Map<String, String> data = {
      'mobile': phone,
      'smsType': "commonCode",
    };
    return HttpNoTokenClient.getInstance()
        .get("cooperation/v1/message/sms", params: data);
  }

  /// 验证验证码
  static Stream checkCode(String phone, String code) {
    Map<String, String> data = {
      'mobile': phone,
      'code': code,
      'smsType': "commonCode",
    };
    return HttpNoTokenClient.getInstance()
        .get("cooperation/v1/message/sms/check", params: data);
  }

  /// 设置新密码
  static Stream resetPwd(String phone, String token, String pwd) {
    Map<String, String> data = {
      'mobile': phone,
      'token': token,
      'newPwd': pwd,
    };
    return HttpNoTokenClient.getInstance().put("admin/v1/member/forget", data);
  }
}
